package com.alibaba.citrus.cr.sales.plan.sdo;

import com.alibaba.citrus.cr.sales.plan.model.enums.SalesPlanModelEnum;
import com.alibaba.citrus.cr.sales.plan.model.features.SalesPlanScItemFeatures;

import org.apache.commons.lang3.StringUtils;

import java.util.Date;
import java.util.Objects;

/**
 * @author zls
 * @description:计划货品扩展SDO
 * @date 2021-09-13 19:21
 */
public class SalesPlanScItemExtendSDO extends SalesPlanStatSDO {
    private static final long serialVersionUID = 5078099652586755420L;

    private Long id;

    /**
     * @see SalesPlanModelEnum
     */
    private Integer model;

    private String modelId;

    /**
     * 汇总类型2：货品维度3：组织维度4：类目维度
     */
    private Integer poolType;

    /**
     * 父级ID
     */
    private String parentId;

    /**
     * 1：业务员货品汇总 2：销售部门货品汇总 3：销售渠道货品汇总 4：销售组织货品汇总 5：业务单元货品汇总
     */
    private Integer bizType;

    /**
     * 数据维度ID
     */
    private String bizId;

    /**
     * 数据维度外部ID
     */
    private String bizOutId;

    /**
     * 货品ID
     */
    private String scItemId;

    /**
     * 货品外部编码
     */
    private String outerId;

    /**
     * 货品名称
     */
    private String scItemName;

    /**
     * 货品组
     */
    private String scItemGroup;

    /**
     * 货品类目ID
     */
    private String scItemCategoryId;

    /**
     * 到岸价
     */
    private Long outboundPrice;

    /**
     * 计划量到岸金额
     */
    private Long planOutboundMoney;

    /**
     * 任务量到岸金额
     */
    private Long taskOutboundMoney;

    /**
     * 调整量到岸金额
     */
    private Long adjustOutboundMoney;

    /**
     * 到岸价
     */
    private Long costInsuranceFreight;

    /**
     * 创建时间
     */
    private Date gmtCreate;

    /**
     * 修改时间
     */
    private Date gmtModified;

    /**
     * 创建人
     */
    private String creator;

    /**
     * 修改人
     */
    private String updater;

    /**
     * 扩展字段
     */
    private SalesPlanScItemFeatures salesPlanScItemFeatures;

    /**
     * 库存量字符串
     */
    private String inventoryStr = "0";

    /**
     * 公司任务量
     */
    private Integer companyTaskCount;

    /**
     * 上旬公司任务量
     */
    private Integer monthFirstCompanyTaskCount;

    /**
     * 中旬公司任务量
     */
    private Integer monthMiddleCompanyTaskCount;

    private Integer monthLastCompanyTaskCount;

    public Integer getCompanyTaskCount() {
        return companyTaskCount;
    }

    public void setCompanyTaskCount(Integer companyTaskCount) {
        this.companyTaskCount = companyTaskCount;
    }

    public Integer getMonthFirstCompanyTaskCount() {
        return monthFirstCompanyTaskCount;
    }

    public void setMonthFirstCompanyTaskCount(Integer monthFirstCompanyTaskCount) {
        this.monthFirstCompanyTaskCount = monthFirstCompanyTaskCount;
    }

    public Integer getMonthMiddleCompanyTaskCount() {
        return monthMiddleCompanyTaskCount;
    }

    public void setMonthMiddleCompanyTaskCount(Integer monthMiddleCompanyTaskCount) {
        this.monthMiddleCompanyTaskCount = monthMiddleCompanyTaskCount;
    }

    public Integer getMonthLastCompanyTaskCount() {
        return monthLastCompanyTaskCount;
    }

    public void setMonthLastCompanyTaskCount(Integer monthLastCompanyTaskCount) {
        this.monthLastCompanyTaskCount = monthLastCompanyTaskCount;
    }

    public String getInventoryStr() {
        return inventoryStr;
    }

    public void setInventoryStr(String inventoryStr) {
        if(StringUtils.isNotBlank(inventoryStr)) {
            this.inventoryStr = inventoryStr;
        }
    }

    /**
     * 可用库存（查询接入库存） 默认为0
     */
    private Long inventory = 0L;

    public Long getInventory() {
        return inventory;
    }

    public void setInventory(Long inventory) {
        if(Objects.nonNull(inventory)) {
            this.inventory = inventory;
        }
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getPoolType() {
        return poolType;
    }

    public void setPoolType(Integer poolType) {
        this.poolType = poolType;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public Integer getBizType() {
        return bizType;
    }

    public void setBizType(Integer bizType) {
        this.bizType = bizType;
    }

    public String getBizId() {
        return bizId;
    }

    public void setBizId(String bizId) {
        this.bizId = bizId;
    }

    public String getBizOutId() {
        return bizOutId;
    }

    public void setBizOutId(String bizOutId) {
        this.bizOutId = bizOutId;
    }

    public String getScItemId() {
        return scItemId;
    }

    public void setScItemId(String scItemId) {
        this.scItemId = scItemId;
    }

    public String getScItemName() {
        return scItemName;
    }

    public void setScItemName(String scItemName) {
        this.scItemName = scItemName;
    }

    public String getScItemGroup() {
        return scItemGroup;
    }

    public void setScItemGroup(String scItemGroup) {
        this.scItemGroup = scItemGroup;
    }

    public Long getCostInsuranceFreight() {
        if (costInsuranceFreight == null){
            return 0L;
        }
        return costInsuranceFreight;
    }

    public void setCostInsuranceFreight(Long costInsuranceFreight) {
        this.costInsuranceFreight = costInsuranceFreight;
    }

    public String getScItemCategoryId() {
        return scItemCategoryId;
    }

    public void setScItemCategoryId(String scItemCategoryId) {
        this.scItemCategoryId = scItemCategoryId;
    }

    public SalesPlanScItemFeatures getSalesPlanScItemFeatures() {
        return salesPlanScItemFeatures;
    }

    public void setSalesPlanScItemFeatures(SalesPlanScItemFeatures salesPlanScItemFeatures) {
        this.salesPlanScItemFeatures = salesPlanScItemFeatures;
    }
    public Integer getModel() {
        return model;
    }

    public void setModel(Integer model) {
        this.model = model;
    }

    public String getModelId() {
        return modelId;
    }

    public void setModelId(String modelId) {
        this.modelId = modelId;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getUpdater() {
        return updater;
    }

    public void setUpdater(String updater) {
        this.updater = updater;
    }

    public String getOuterId() {
        return outerId;
    }

    public void setOuterId(String outerId) {
        this.outerId = outerId;
    }

    public Long getOutboundPrice() {
        return outboundPrice;
    }

    public void setOutboundPrice(Long outboundPrice) {
        this.outboundPrice = outboundPrice;
    }

    public Long getPlanOutboundMoney() {
        return planOutboundMoney;
    }

    public void setPlanOutboundMoney(Long planOutboundMoney) {
        this.planOutboundMoney = planOutboundMoney;
    }

    public Long getTaskOutboundMoney() {
        return taskOutboundMoney;
    }

    public void setTaskOutboundMoney(Long taskOutboundMoney) {
        this.taskOutboundMoney = taskOutboundMoney;
    }

    public Long getAdjustOutboundMoney() {
        return adjustOutboundMoney;
    }

    public void setAdjustOutboundMoney(Long adjustOutboundMoney) {
        this.adjustOutboundMoney = adjustOutboundMoney;
    }
}
